﻿
/*----------------------------------------------------------------//
// 文件名：MoSamplekeptlog.cs
// 文件功能描述：实体 MoSamplekeptlog.
// 
// 创建标识：2009-07-29
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoSamplekeptlog
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoSamplekeptlog
	/// </summary>
	public partial class MoSamplekeptlog:ICloneable
	{
		#region 表Samplekeptlog的字段
		private int _id;
		private string _sam_kep_id;
		private string _sender;
		private string _receiver;
		private string _status;
		private DateTime _keptdate;
		private DateTime _enddate;
		private string _storeaddr;
		private string _rem;
		#endregion
		
		#region 构造函数
		public MoSamplekeptlog()
		{
		    
		    
		    
		    
		    
		    _keptdate= DateTime.Now;
		    _enddate= DateTime.Now;
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoSamplekeptlog(MoSamplekeptlog item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoSamplekeptlog(int id,string sam_kep_id,string sender,string receiver,string status,DateTime keptdate,DateTime enddate,string storeaddr,string rem)
		{
		this._id=id;
		this._sam_kep_id=sam_kep_id;
		this._sender=sender;
		this._receiver=receiver;
		this._status=status;
		this._keptdate=keptdate;
		this._enddate=enddate;
		this._storeaddr=storeaddr;
		this._rem=rem;
		}
		#endregion
		
		#region 表Samplekeptlog的字段属性
		/// <summary>
		///流水号
		/// </summary>
		public int Id
		{
			get {return _id;}
			set {_id=value;}
		}
		/// <summary>
		///样品登记编号
		/// </summary>
		public string Sam_Kep_Id
		{
			get {return _sam_kep_id;}
			set {_sam_kep_id=value;}
		}
		/// <summary>
		///交接人
		/// </summary>
		public string Sender
		{
			get {return _sender;}
			set {_sender=value;}
		}
		/// <summary>
		///接收人
		/// </summary>
		public string Receiver
		{
			get {return _receiver;}
			set {_receiver=value;}
		}
		/// <summary>
		///状态，在管或已交接
		/// </summary>
		public string Status
		{
			get {return _status;}
			set {_status=value;}
		}
		/// <summary>
		///交接日期
		/// </summary>
		public DateTime Keptdate
		{
			get {return _keptdate;}
			set {_keptdate=value;}
		}
		/// <summary>
		///接管结束日期
		/// </summary>
		public DateTime Enddate
		{
			get {return _enddate;}
			set {_enddate=value;}
		}
		/// <summary>
		///样品存放位置
		/// </summary>
		public string Storeaddr
		{
			get {return _storeaddr;}
			set {_storeaddr=value;}
		}
		/// <summary>
		///交接备注
		/// </summary>
		public string Rem
		{
			get {return _rem;}
			set {_rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoSamplekeptlog CopyTo(MoSamplekeptlog item)
        {
		    item.Id=this.Id;
		    item.Sam_Kep_Id=this.Sam_Kep_Id;
		    item.Sender=this.Sender;
		    item.Receiver=this.Receiver;
		    item.Status=this.Status;
		    item.Keptdate=this.Keptdate;
		    item.Enddate=this.Enddate;
		    item.Storeaddr=this.Storeaddr;
		    item.Rem=this.Rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoSamplekeptlog NewSamplekeptlog=new MoSamplekeptlog();
		    NewSamplekeptlog._id=this._id;
		    NewSamplekeptlog._sam_kep_id=this._sam_kep_id;
		    NewSamplekeptlog._sender=this._sender;
		    NewSamplekeptlog._receiver=this._receiver;
		    NewSamplekeptlog._status=this._status;
		    NewSamplekeptlog._keptdate=this._keptdate;
		    NewSamplekeptlog._enddate=this._enddate;
		    NewSamplekeptlog._storeaddr=this._storeaddr;
		    NewSamplekeptlog._rem=this._rem;
			return NewSamplekeptlog;
		}
		
		private static MoSamplekeptlog _empty = new MoSamplekeptlog(-1,string.Empty,string.Empty,string.Empty,string.Empty,DateTime.MinValue,DateTime.MinValue,string.Empty,string.Empty);
        public static MoSamplekeptlog Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoSamplekeptlog NewSamplekeptlog = obj as MoSamplekeptlog;
                if (NewSamplekeptlog == null)
                {
                    return false;
                }
                else
                {
				if (NewSamplekeptlog.Id==this.Id && NewSamplekeptlog.Sam_Kep_Id==this.Sam_Kep_Id && NewSamplekeptlog.Sender==this.Sender && NewSamplekeptlog.Receiver==this.Receiver && NewSamplekeptlog.Status==this.Status && NewSamplekeptlog.Keptdate==this.Keptdate && NewSamplekeptlog.Enddate==this.Enddate && NewSamplekeptlog.Storeaddr==this.Storeaddr && NewSamplekeptlog.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Id={0}/Sam_Kep_Id={1}/Sender={2}/Receiver={3}/Status={4}/Keptdate={5}/Enddate={6}/Storeaddr={7}/Rem={8}",_id,_sam_kep_id,_sender,_receiver,_status,_keptdate,_enddate,_storeaddr,_rem);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["ID"]!=null && row["ID"]!=DBNull.Value)
			{
			    this.Id = (int)row["ID"];
			}
			else
			{
				this.Id =-1;
			}
		    if(row["Sam_Kep_ID"]!=null && row["Sam_Kep_ID"]!=DBNull.Value)
			{
			    this.Sam_Kep_Id = (string)row["Sam_Kep_ID"];
			}
			else
			{
				this.Sam_Kep_Id =string.Empty;
			}
		    if(row["Sender"]!=null && row["Sender"]!=DBNull.Value)
			{
			    this.Sender = (string)row["Sender"];
			}
			else
			{
				this.Sender =string.Empty;
			}
		    if(row["Receiver"]!=null && row["Receiver"]!=DBNull.Value)
			{
			    this.Receiver = (string)row["Receiver"];
			}
			else
			{
				this.Receiver =string.Empty;
			}
		    if(row["Status"]!=null && row["Status"]!=DBNull.Value)
			{
			    this.Status = (string)row["Status"];
			}
			else
			{
				this.Status =string.Empty;
			}
		    if(row["KeptDate"]!=null && row["KeptDate"]!=DBNull.Value)
			{
			    this.Keptdate = (DateTime)row["KeptDate"];
			}
			else
			{
				this.Keptdate =DateTime.MinValue;
			}
		    if(row["EndDate"]!=null && row["EndDate"]!=DBNull.Value)
			{
			    this.Enddate = (DateTime)row["EndDate"];
			}
			else
			{
				this.Enddate =DateTime.MinValue;
			}
		    if(row["StoreAddr"]!=null && row["StoreAddr"]!=DBNull.Value)
			{
			    this.Storeaddr = (string)row["StoreAddr"];
			}
			else
			{
				this.Storeaddr =string.Empty;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["ID"] = this.Id;
			row["Sam_Kep_ID"] = this.Sam_Kep_Id;
			row["Sender"] = this.Sender;
			row["Receiver"] = this.Receiver;
			row["Status"] = this.Status;
			row["KeptDate"] = this.Keptdate;
			row["EndDate"] = this.Enddate;
			row["StoreAddr"] = this.Storeaddr;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
